home *** CD-ROM | disk | FTP | other *** search
- Path: yarrina.connect.com.au!usenet
- From: Andrew Dalgleish <andrewd@axonet.com.au>
- Newsgroups: comp.lang.c++
- Subject: Re: A question of (lexical) style
- Date: Fri, 08 Mar 1996 11:09:20 +1000
- Organization: Axon Research, Pty Ltd
- Message-ID: <313F88C0.282@axonet.com.au>
- References: <313c99bc.0@193.89.47.9>
- NNTP-Posting-Host: andrew.axonet.com.au
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Win95; I)
-
- Brian Elgaard wrote:
- >
- > A question of (lexical) style
- >
- > I am currently writing guidelines for C++ programmers, and I am in doubt about how to place * and & in declarations.
- >
- > I prefer to put the type modifier close to the type, such as in:
- >
- > int& Foo()
- > {
- > int* a;
- > int& b = a;
- > }
- >
- > This seems natural to me if declarations with modifiers are restricted to declare a single variable.
- > [snip]
-
- One problem comes from declaring:
-
- int* a,b,c;
-
- which is equivalent to:
-
- int *a;
- int b,c;
-
- If you apply your "single variable" restriction, you have an exception.
- Why do it one way for here, but a different way there?
- Consistency is always a good thing (up to a point).
-
- --
- Andrew Dalgleish
-